com.atlassian.jira.rpc.auth
Class TokenManagerImpl

java.lang.Object
  extended by com.atlassian.jira.rpc.auth.TokenManagerImpl
All Implemented Interfaces:
TokenManager

public class TokenManagerImpl
extends java.lang.Object
implements TokenManager


Field Summary
private  JiraAuthenticationContext authenticationContext
           
static long DEFAULT_TIMEOUT
           
private static Logger log
           
private  LoginService loginService
           
private  PermissionManager permissionManager
           
private static java.lang.String TRUSTED_APPS_TOKEN
           
private  UserManager userManager
           
private  java.util.Map<java.lang.String,java.lang.String> userTokens
           
 
Constructor Summary
TokenManagerImpl(long timeout, PermissionManager permissionManager, LoginService loginService, JiraAuthenticationContext authenticationContext, UserManager userManager)
           
TokenManagerImpl(PermissionManager permissionManager, LoginService loginService, JiraAuthenticationContext authenticationContext, UserManager userManager)
           
 
Method Summary
private  java.lang.String createToken(User user)
           
private  User getUserFromToken(java.lang.String token)
           
 java.lang.String login(java.lang.String username, java.lang.String password)
           
 boolean logout(java.lang.String token)
           
 User retrieveUser(java.lang.String token)
          Retrieve the user, checking that the token is valid, and that the user has the 'USE' permission
 User retrieveUserNoPermissionCheck(java.lang.String token)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static long DEFAULT_TIMEOUT

log

private static final Logger log

userTokens

private final java.util.Map<java.lang.String,java.lang.String> userTokens

permissionManager

private PermissionManager permissionManager

loginService

private final LoginService loginService

authenticationContext

private final JiraAuthenticationContext authenticationContext

userManager

private final UserManager userManager

TRUSTED_APPS_TOKEN

private static final java.lang.String TRUSTED_APPS_TOKEN
See Also:
Constant Field Values
Constructor Detail

TokenManagerImpl

public TokenManagerImpl(PermissionManager permissionManager,
                        LoginService loginService,
                        JiraAuthenticationContext authenticationContext,
                        UserManager userManager)

TokenManagerImpl

TokenManagerImpl(long timeout,
                 PermissionManager permissionManager,
                 LoginService loginService,
                 JiraAuthenticationContext authenticationContext,
                 UserManager userManager)
Method Detail

login

public java.lang.String login(java.lang.String username,
                              java.lang.String password)
                       throws RemoteException
Specified by:
login in interface TokenManager
Throws:
RemoteException

logout

public boolean logout(java.lang.String token)
Specified by:
logout in interface TokenManager

createToken

private java.lang.String createToken(User user)
                              throws RemoteException
Throws:
RemoteException

retrieveUser

public User retrieveUser(java.lang.String token)
                  throws RemoteAuthenticationException,
                         RemotePermissionException
Description copied from interface: TokenManager
Retrieve the user, checking that the token is valid, and that the user has the 'USE' permission

Specified by:
retrieveUser in interface TokenManager
Returns:
A valid user. Note that this method will never return null
Throws:
RemoteAuthenticationException - If the token is not valid, or if it has timed out
RemotePermissionException - If the user does not have the 'USE' permission.

retrieveUserNoPermissionCheck

public User retrieveUserNoPermissionCheck(java.lang.String token)
                                   throws RemoteAuthenticationException,
                                          RemotePermissionException
Specified by:
retrieveUserNoPermissionCheck in interface TokenManager
Throws:
RemoteAuthenticationException
RemotePermissionException

getUserFromToken

private User getUserFromToken(java.lang.String token)
                       throws RemoteAuthenticationException
Throws:
RemoteAuthenticationException